<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Oct 10, 2010
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/tmpl/my_stats.php
 ^ 
 * Description: template view for my stats
 ^ 
 * History:		NONE
 ^ 
 */
 
 defined('_JEXEC') or die('Restricted access');
 
 global $mainframe;
 $link = 'index.php?option=com_wrecruit&c=wrecruit&view=jobseeker&layout=my_stats&Itemid='.$this->Itemid;
  $document =& JFactory::getDocument();
   $document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);

 ?>

<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	<?php echo $this->config['title']; ?></td></tr>
	<tr><td height="25"></td></tr>
	<tr><td class="wrecruitmsg">
		<?php echo $this->config['offline_text']; ?>
	</td></tr>
</table>	
<?php }else{ ?>

<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	
		<?php echo $this->config['title']; ?>
	</td>
	</tr>
	<tr><td height="23"></td></tr>
	<?php if ($this->config['cur_location'] == 1) {?>
	<tr><td height="0"></td></tr>
	<tr><td class="curloc">
		<?php echo JText::_('JS_CUR_LOC'); ?> : <?php echo JText::_('JS_MY_STATS'); ?>
	</td></tr>
	<?php } ?>
	<tr><td>
		<?php 
			if (sizeof($this->jobseekerlinks) != 0){
				echo '<div id="toplinks"><ul>';
				foreach($this->jobseekerlinks as $lnk)	{ ?>
					<span <?php if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  ?>>
						<a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
					</span>
				<?php }
				echo '<ul></div>';
			}
		?>
	</td></tr>	
	<tr><td height="3"></td></tr>
	<tr><td class="<?php echo $this->theme['heading']; ?>" align="center">
		<?php echo JText::_('JS_MY_STATS'); ?>
	</td></tr>
	<tr><td height="3"></td></tr>
</table>


<?php
if ($this->userrole->rolefor == 2) { // jobseeker
    $isodd =1;
    $tdclass = array($this->theme['odd'], $this->theme['even']);
?>
	<table cellpadding="0" cellspacing="0" border="0" width="100%" >
		<tr  class="<?php echo $this->theme['sortlinks']; ?>" valign="middle">
                    <td  width="25%" ><strong></strong></td>
                    <td  width="25%" align="center"><strong><?php echo JText::_('JS_CURRENT_ALLOW'); ?></strong></td>
                    <td width="25%" align="center"><strong><?php echo JText::_('JS_TOTAL'); ?></strong></td>
                    <td width="25%" align="center"><strong><?php echo JText::_('%'); ?></strong></td>
                </tr>
                <?php $isodd = 1 - $isodd; ?>
                <tr class="<?php echo $tdclass[$isodd]; ?>">
                    <td><strong><?php echo JText::_('JS_RESUMES'); ?></strong></td>
                    <td align="center"><?php if($this->resumeallow== -1) echo JText::_('JS_UNLIMITED');echo $this->resumeallow; ?></td>
                    <td align="center"><?php echo $this->totalresume; ?></td>
                    <td align="center"><?php $output = '-'; if($this->resumeallow!= -1) if ($this->totalresume <= $this->resumeallow) if($this->resumeallow != 0) $output = round(($this->totalresume/$this->resumeallow)*100) .' %' ; echo $output; ?></td>
		</tr>
                <?php $isodd = 1 - $isodd; ?>
                <tr class="<?php echo $tdclass[$isodd]; ?>">
                    <td><strong><?php echo JText::_('JS_GOLD_RESUMES'); ?></strong></td>
                    <td align="center"><?php if($this->goldresumeallow== -1) echo JText::_('JS_UNLIMITED');else echo $this->goldresumeallow; ?></td>
                    <td align="center"><?php echo $this->totalgoldresume; ?></td>
                    <td align="center"><?php $output = '-'; if($this->goldresumeallow!= -1) if ($this->totalgoldresume <= $this->goldresumeallow) if($this->goldresumeallow != 0) $output = round(($this->totalgoldresume/$this->goldresumeallow)*100) .' %' ; echo $output; ?></td>
		</tr>
                <?php $isodd = 1 - $isodd; ?>
                <tr class="<?php echo $tdclass[$isodd]; ?>">
                    <td><strong><?php echo JText::_('JS_FEATURED_RESUMES'); ?></strong></td>
                    <td align="center"><?php if($this->featuredresumeallow== -1) echo JText::_('JS_UNLIMITED');else echo $this->featuredresumeallow; ?></td>
                    <td align="center"><?php echo $this->totalfeaturedresume; ?></td>
                    <td align="center"><?php $output = '-'; if($this->featuredresumeallow!= -1) if ($this->totalfeaturedresume <= $this->featuredresumeallow) if($this->featuredresumeallow != 0) $output = round(($this->totalfeaturedresume/$this->featuredresumeallow)*100) .' %' ; echo $output; ?></td>
		</tr>
                <?php $isodd = 1 - $isodd; ?>
                <tr class="<?php echo $tdclass[$isodd]; ?>">
                    <td><strong><?php echo JText::_('JS_COVER_LETTERS'); ?></strong></td>
                    <td align="center"><?php if($this->coverlettersallow== -1) echo JText::_('JS_UNLIMITED');else echo $this->coverlettersallow; ?></td>
                    <td align="center"><?php echo $this->totalcoverletters; ?></td>
                    <td align="center"><?php $output = '-'; if($this->coverlettersallow!= -1) if ($this->totalcoverletters <= $this->coverlettersallow) if($this->coverlettersallow != 0) $output = round(($this->totalcoverletters/$this->coverlettersallow)*100) .' %' ; echo $output; ?></td>
		</tr>
	</table>
			

<?php


} else{ // not allowed job posting
echo JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_VIEW');
}	
}//ol
?>	
<div width="100%">
<?php 
if($this->config['fr_cr_txsh']) {
	echo 
	'<table width="100%" style="table-layout:fixed;">
		<tr><td height="15"></td></tr>
		<tr><td style="vertical-align:top;" align="center">'.$this->config['fr_cr_txa'].$this->config['fr_cr_txb'].'</td></tr>
	</table>';
}	
?>
</div>


